Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.getCustomerService = function() {
    return new Promise(function(r, n) {
        var o = wx.getStorageSync("projectVerificationCustomerService");
        if (o && o.storageTime < Date.now() && (o = null), o) r(o); else {
            var i = t.getNetAddresss("plugin.store-projects.frontend.index.get-base-info");
            t._getNetWork({
                url: i,
                success: function(t) {
                    var n = t.data, o = n.data, i = n.msg;
                    0 != n.result ? (wx.setStorageSync("projectVerificationCustomerService", e(e({}, o.cservice), {}, {
                        storageTime: Date.now() + 36e5
                    })), r(o.cservice)) : wx.showToast({
                        title: i,
                        icon: "none"
                    });
                },
                fail: function(e) {
                    n(e);
                }
            });
        }
    });
}, exports.getLocation = function() {
    return new Promise(function(e, t) {
        var n = wx.getStorageSync("address-point");
        if (n) return r(n.point.lat, n.point.lng), void e(n);
        wx.getLocation({
            type: "gcj02",
            isHighAccuracy: !0
        }).then(function(t) {
            r(t.latitude, t.longitude).then(function(t) {
                e(t);
            });
        }).catch(function() {
            e({
                point: {
                    lat: "0.0",
                    lng: "0.0"
                }
            });
        });
    });
}, exports.getProjectNameLang = function() {
    var e, t, r = wx.getStorageSync("yz_basic_info");
    return null !== (e = r.lang) && void 0 !== e && null !== (t = e.store_projects) && void 0 !== t && t.project ? r.lang.store_projects.project : "项目";
};

var e = require("../../@babel/runtime/helpers/objectSpread2"), t = getApp();

function r(e, r) {
    return t.getReverseGeocoder(e, r).then(function(n) {
        var o;
        o = t._isTextEmpty(n.formatted_addresses) ? "" : n.formatted_addresses.recommend;
        var i = {
            point: {
                lat: e,
                lng: r
            }
        };
        return o && (i.title = o, i.address = n.address, i.city = t._isTextEmpty(n.address_component.city) ? n.address_component.province : n.address_component.city), 
        i;
    });
}